<template>
  <div id="top">
      <div class="topboxx">
        <!--蓝色矩形-->
        <div class="topbox"></div>  
      </div>

        <div class="text1edit3">
            <p>新增团队信息</p>
        </div>
        <div class="topbox2">
            <div class="p1box">
                <p class="p1">团队信息</p>
            </div>
        </div>

        <div class="adddoctor_1">
            <table border="0px" width="1000px" height="200px">
                <tr>
                    <td align='right'><font color='#999999'>团队编号</font></td>
                    <td width='200px'></td>
                    <td align='right'><font color='#999999'>团队名称</font></td>
                    <td width='200px'>
                        <el-input  placeholder="请输入" v-model="list1.team_name" ></el-input>
                    </td>
                    <td align='right'><font color='#999999'>机构图片</font></td>
                    <td>
                       <el-upload
                            class="upload-demo"
                            action="https://jsonplaceholder.typicode.com/posts/"
                            :on-preview="handlePreview"
                            :on-remove="handleRemove"
                            :file-list="fileList"
                            list-type="picture">
                            <el-button size="small" v-model="list1.team_img"  type="primary">点击上传</el-button>
                        </el-upload>
                    </td>
                </tr>
                <tr>
                    <td align='right'><font color='#999999'>所属机构</font></td>
                    <td>
                        <el-select  v-model="list1.team_label" placeholder="请选择">
                             <el-option 
                                v-for="item in lista1"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                            </el-option>
                         </el-select>
                    </td>
                    <td align='right'><font color='#999999'>团队标签</font></td>
                    <td>
                        <el-select  v-model="list1.team_organization" placeholder="请选择">
                             <el-option 
                                v-for="item in lista2"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                            </el-option>
                         </el-select>
                    </td>
                    <td colspan="2"></td>
                </tr>
            </table>
        </div>


        <div class="flowbtn222">
            <router-link to="/datas04">
                <el-button
                    plain
                    type="primary"
                    @click="baocun1">
                    保存
                </el-button>
            </router-link>
                <router-link to="/datas04">
                <el-button>返回</el-button>
                </router-link>
    </div>



  </div>
</template>

<script>
import { postRequest } from '@/utils/api'
import axios from "axios";
axios.defaults.baseURL="http://localhost:8080"
export default {
   data () {
       return {
        lista1: [
            {
            value: 1,
            label: "罗西社区服务中心",
            },
            {
            value: 2,
            label: "天明社区服务中心",
            },{
            value: 3,
            label: "民进社区服务中心",
            },
        ],
         value: "", 

        lista2: [
            {
            value: 1,
            label: "慢性病理",
            },
            {
            value: 2,
            label: "高血压",
            },{
            value: 3,
            label: "高血糖",
            },
        ],
        value1: "", //所属机构

        list1:[]
       }
   },
   methods: {
        baocun1(){
            postRequest('data/addTeamList',this.list1).then(resp=>{
                this.$message.success('保存成功')
                this.list = resp.data
            })
        },

        //上传头像
    //   handleRemove(file, fileList) {
    //     console.log(file, fileList);
    //   },
      handlePreview(file) {
        this.list1.team_img = "http://localhost:8080/"+file.name
      }
   },
}
</script>

<style>
*{
    padding: 0;
    margin: 0;
}
#top{
    width: 1150px;
    height: 900px;
     background: white;
    margin: 20px auto;
    position: relative;
}
.topbox{
    border-width: 0px;
    position: absolute;
    left: 0px;
    top: 0px;
    width: 6px;
    height: 20px;
    background: inherit;
    background-color: rgba(41, 132, 248, 1);
    border: none;
    border-radius: 8px;
    -moz-box-shadow: none;
    -webkit-box-shadow: none;
    box-shadow: none;
}
.topboxx{
    border-width: 0px;
    position: absolute;
    left: 40px;
    top: 42px;
    width: 6px;
    height: 20px;
}
.text1edit3{
    position: absolute;
    left: 50px;
    top: 43px;
    font-size: 18px;
}
.topbox2{
    position:absolute;
    top: 80px;
    left: 40px;
}
.p1box{
    margin-top: 40px;
}
.p1box11{
    margin-top: 370px;
    margin-left: 10px;
}
.dianjishangchuan1{
    color: blue;
}
.dianjishangchuan1:hover{
    color: blue;
    text-decoration: underline;
}
.adddoctor_1{
    position: absolute;
    left: 40px;
    top: 150px;
}
.flowbtn222{
    position: absolute;
    left: 120px;
    top: 400px;
}
</style>